<template>
  <el-container>
    <el-header>
      <div class="top_box xq">
        <img
          style="cursor: pointer"
          @click="webopen()"
          src="../../assets/image/logo.png"
          alt=""
        />
      </div>
      <div class="title_bj_box xq bg"></div>
    </el-header>
    <el-main>
      <div class="jb_box">
        <div class="xq_tag_box">
          <div class="xq_tab">{{ $route.query.name }}</div>
        </div>
        <div class="zx_table_box">
          <el-table :data="tableData" stripe fit>
            <el-table-column prop="year" label="年度"> </el-table-column>
            <el-table-column prop="level" label="资信等级"> </el-table-column>
          </el-table>
          <div class="pagination_bg">
            <el-pagination
              hide-on-single-page
              background
              :pager-count="5"
              layout="prev, pager, next"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :total="total"
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </el-main>
    <el-footer>
      <foot></foot>
    </el-footer>
  </el-container>
</template>
      
      <script>
import tab from "../../components/tab.vue";
import foot from "../../components/foot.vue";
import env from "@/../env.js";

export default {
  data() {
    return {
      tableData: [],
      total: 0,
      currentPage: 1,
      url: env.API_BASE_URL,
    };
  },
  components: {
    tabVue: tab,
    foot: foot,
  },
  mounted() {
    this.getinfo();
  },
  methods: {
    /**
     * 分页
     * @param {页码} currentPage
     */
    handleCurrentChange(page) {
      // 当分页发生变化时的处理函数
      this.currentPage = page;
      this.getinfo();
    },
    /**
     * 获取列表
     */
    getinfo() {
      let that = this;
      let data = {
        page: that.currentPage,
        mechanism_id: this.$route.query.id,
      };
      that.$http.post("credit/list_detail", data).then((res) => {
        if (res.code === 1) {
          that.total = res.data.total;
          that.tableData = res.data.data;
        } else {
          that.total = 0;
          that.tableData = [];
        }
      });
    },
    webopen() {
      window.open(this.url);
    },
    //  ==
  },
};
</script>
      <style>
.el-header {
  margin: 0%;
  padding: 0;
  height: auto !important;
  width: auto;
}
.el-card__body,
.el-main {
  margin: 0%;
  padding: 0%;
  min-height: calc(100vh - 7.22rem);
}
.top_box {
  background-image: url("../../assets/image/首页顶部背景.jpg");
  background-size: 100% 100%;
  height: 1.75rem;
  width: 100%;
  display: flex;
  align-items: center;
}
.top_box img {
  width: 10rem;
  margin-left: 4.3rem;
}
/* .bg .title_bj_box {

  height: 2rem !important;
  background-color: red;
} */

.jb_box {
  width: 15rem;
  background: #ffffff;
  border-radius: 0.125rem;
  margin: 0.75rem auto 1.25rem;
  box-shadow: 1px 1px 3px 2px rgba(0, 0, 0, 0.15);
}
.xq_tag_box {
  border-bottom: solid 0.0375rem #1954a4;
  display: flex;
  align-items: center;
  height: 0.75rem;
  padding-left: 0.25rem;
  box-sizing: border-box;
}
.xq_tab {
  border-left: solid 0.075rem #1954a4;
  font-size: 20px;
  font-weight: 400;
  color: #1954a4;
  padding-left: 0.2125rem;
  box-sizing: border-box;
}
.zx_table_box {
  padding: 0.2625rem;
  margin-top: 0.125rem;
}
.zx_table_box .el-table__header thead th {
  background-color: #1954a4 !important;
  height: 0.2125rem;
  font-size: 16px;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
}
.zx_table_box .el-table__body-wrapper tbody td {
  text-align: center;
  font-size: 16px;
  color: #333 !important;
}
.pagination_bg {
  margin: 2% auto 0;
  text-align: center;
}
.pagination_bg .el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #1954a4;
}
</style>
      
      